function diff = gen_data(X1, X2, norm_type)
%generate_data Preprocesses the data given - each pair is transformed
%              into norm(X1 - X2) - norm can be L1, L2 or  Hellinger
%              distance.
    num_of_pics = size(X1,2);
    diff = zeros(102,num_of_pics);
    
    for pic=1:num_of_pics
        for i=1:102
            if strcmp(norm_type,'hellinger')
                diff(i,pic) = hellinger_norm(X1(1*i:61*i, pic),...
                                             X2(1*i:61*i, pic));
            elseif strcmp(norm_type,'L1')
                diff(i,pic) = norm(X1(1*i:61*i, pic)-X2(1*i:61*i, pic),1);
            elseif strcmp(norm_type,'L2')
                diff(i,pic) = norm(X1(1*i:61*i, pic)-X2(1*i:61*i, pic),2);
            else
                fprintf('Norm type not supported.');
            end
        end
    end
    
    diff = diff';
end

